<?php

class reporte_model_posgrado extends CI_Model {

    private $claveuv = "30MSU0940B";
    public $programa = "AMBI-10-E-CR";
    public $distrito = "1";

    function __construct() {
        parent :: __construct();
    }

    function opcionesdecarreras() {
        $dbres = $this->db->get('general_pos');
        $ddmenu = array();
        foreach ($dbres->result_array() as $tablerow) {
            $ddmenu[$tablerow['PROGRAMA'] . '/' . $tablerow['DIST']] = $tablerow['DIST'] . ' - ' . $tablerow['DCARRERA'] . ' - ' . $tablerow['MODALIDAD'] . ' - ' . $tablerow['GRADO'];
        }
        return $ddmenu;
    }

    function get_generales_pos() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('general_pos')->row_array();
    }

    function get_egreso_pos() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('egreso_pos')->row_array();
    }

    function get_ingreso_pos() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('ingreso_pos')->row_array();
    }

    function get_titulados_pos() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('titulados_pos')->row_array();
    }

    function get_permanencia_pos() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('permanencia_pos')->row_array();
    }

    function get_docentes_esco() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('docentes_esco_pos')->row_array();
    }

    function get_docentes_noesco() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('docentes_noesco_pos')->row_array();
    }

    function generatodo() {
        $this->hoja1();
        $this->hoja2();
        $this->hoja3();
        $this->hoja4();
        $this->hoja5();
        $this->hoja6();
        $this->hoja7();
        $this->hoja8();
        $this->hoja9();
        $this->hoja10();
        $this->hoja11();
        $this->hoja12();
        /* $this->hoja13(); */
    }

    function hoja1() {
        extract($this->get_generales_pos());

        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 1)), true);
        $this->mpdf->WriteHTML($vista);

        $s = $this->claveuv;
        $this->mpdf->WriteText(83, 57, expandeespacios($s));
        $uv = "UNIVERSIDAD VERACRUZANA";
        $this->mpdf->WriteText(92, 67, ($uv));
        $claveescuela = $FACU;
        $this->mpdf->WriteText(82.5, 76.5, expandeespacios($claveescuela));
        $facultad = trim($DFACULTAD);
        $this->mpdf->WriteText(50, 86.9, ($facultad));
        $clavecarrera = $CARR;
        $this->mpdf->WriteText(82.5, 99.5, expandeespacios($clavecarrera));
        $carrera = "$GRADO EN " . trim($DCARRERA) . "-$MODALIDAD-$CAMPUS";
        $this->mpdf->WriteText(16, 109.8, ($carrera));
        $clavecarrera2 = $CARR2;
        $this->mpdf->WriteText(184, 99.5, expandeespacios($clavecarrera2));
        if ($MODALIDAD == 'ESCOLARIZADO') {
            $escolar = "X";
            $this->mpdf->WriteText(41, 123.5, expandeespacios($escolar));
        } else {
            $semiescolar = "X";
            $this->mpdf->WriteText(247, 123.5, expandeespacios($semiescolar));
        }
    }

    function hoja2() {
        extract($this->get_generales_pos());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 2)), true);
        $this->mpdf->WriteHTML($vista);
        if ($GRADO == 'ESPECIALIZACION' || $GRADO == 'MAESTRIA') {
            $tecnico = "X";
            $this->mpdf->WriteText(162, 44, expandeespacios($tecnico));
        }
        if ($GRADO == 'DOCTORADO') {
            $lic = "X";
            $this->mpdf->WriteText(201.5, 44, expandeespacios($lic));
        }
        $aniocreacion = substr($FCPE, 0, -4);
        $this->mpdf->WriteText(142.5, 75.5, expandeespacios($aniocreacion));
        $mescreacion = substr($FCPE, 4, -2);
        $this->mpdf->WriteText(199, 75.5, expandeespacios($mescreacion));
        $diacreacion = substr($FCPE, 6);
        $this->mpdf->WriteText(239, 75.5, expandeespacios($diacreacion));
        $creditos = ajustaa($CRED, 4);
        $this->mpdf->WriteText(180, 153, expandeespacios($creditos));
        $duracion = ajustaa($DUR, 2);
        $this->mpdf->WriteText(142, 106.5, expandeespacios($duracion));

        if ($EST == 'Semestres') {
            $semestres = "X";
            $this->mpdf->WriteText(181, 115, expandeespacios($semestres));
        }else{
            $otro = "X";
            $this->mpdf->WriteText(227, 115, expandeespacios($otro));
            $this->mpdf->WriteText(190, 127, $EST);
        }
        if ($TIPO_ADMI == 'SEMESTRAL') {
            $semestral = "X";
            $this->mpdf->WriteText(170, 182.5, expandeespacios($semestral));
        }
        if ($TIPO_ADMI == 'ANUAL') {
            $semestral = "X";
            $this->mpdf->WriteText(142, 182.5, expandeespacios($semestral));
        }
        if ($TIPO_ADMI == 'GENERACIONAL') {
            $semestral = "X";
            $this->mpdf->WriteText(198, 182.5, expandeespacios($semestral));
        }
    }

    function hoja3() {
        extract($this->get_generales_pos());

        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 3)), true);
        $this->mpdf->WriteHTML($vista);

        $periodos = $NP;
        $this->mpdf->WriteText(143, 65, expandeespacios($periodos));
        $anioperiodo1 = "2010";
        $this->mpdf->WriteText(147.5, 88, expandeespacios($anioperiodo1));
        $mesperiodo1 = "08";
        $this->mpdf->WriteText(175, 88, expandeespacios($mesperiodo1));
        if ($NP == 2) {
            $anioperiodo2 = "2011";
            $this->mpdf->WriteText(147.5, 94, expandeespacios($anioperiodo2));
            $mesperiodo2 = "02";
            $this->mpdf->WriteText(175, 94, expandeespacios($mesperiodo2));
        }
        extract($this->get_ingreso_pos());
        $hombres = ajustaa($NIH, 4);
        $this->mpdf->WriteText(190.5, 88, expandeespacios($hombres));
        $mujeres = ajustaa($NIM, 4);
        $this->mpdf->WriteText(216.5, 88, expandeespacios($mujeres));
        $total = ajustaa($TNI1, 4);
        $this->mpdf->WriteText(242.5, 88, expandeespacios($total));
        if ($NP == 2) {
            $hombres2 = ajustaa($NHP2, 4);
            $this->mpdf->WriteText(190.5, 94, expandeespacios($hombres2));
            $mujeres2 = ajustaa($NMP2, 4);
            $this->mpdf->WriteText(216.5, 94, expandeespacios($mujeres2));
            $total2 = ajustaa($TNI2, 4);
            $this->mpdf->WriteText(242.5, 94, expandeespacios($total2));
        }
        extract($this->get_egreso_pos());
        $egrehombres = ajustaa($TEGH, 4);
        $this->mpdf->WriteText(141, 141, expandeespacios($egrehombres));
        $egremujeres = ajustaa($TEGM, 4);
        $this->mpdf->WriteText(172.7, 141, expandeespacios($egremujeres));
        $egretotal = ajustaa($TEGT, 4);
        $this->mpdf->WriteText(209.8, 141, expandeespacios($egretotal));
        $egrecondiscapacidad = ajustaa($TEG_DIS, 3);
        $this->mpdf->WriteText(245.5, 141, expandeespacios($egrecondiscapacidad));

        extract($this->get_titulados_pos());
        $tituladoshombres = ajustaa($TTIH, 4);
        $this->mpdf->WriteText(141, 169.5, expandeespacios($tituladoshombres));
        $tituladosmujeres = ajustaa($TTIM, 4);
        $this->mpdf->WriteText(172.7, 169.5, expandeespacios($tituladosmujeres));
        $tituladostotal = ajustaa($TTIT, 4);
        $this->mpdf->WriteText(209.3, 169.5, expandeespacios($tituladostotal));
        $titcondiscapacidad = ajustaa($TTI_DIS, 3);
        $this->mpdf->WriteText(245.5, 169.5, expandeespacios($titcondiscapacidad));
    }

    function hoja4() {
        extract($this->get_generales_pos());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 4)), true);
        $this->mpdf->WriteHTML($vista);

        $anioinicio = substr($FINI, 0, -4);
        $this->mpdf->WriteText(142, 62, expandeespacios($anioinicio));
        $mesinicio = substr($FINI, 4, -2);
        $this->mpdf->WriteText(182.5, 62, expandeespacios($mesinicio));
        $diainicio = substr($FINI, 6);
        $this->mpdf->WriteText(211, 62, expandeespacios($diainicio));
        //this->mpdf->WriteText(142, 55.5, expandeespacios('2011'));
        //$this->mpdf->WriteText(177, 55.5, expandeespacios('08'));
        //$this->mpdf->WriteText(217, 58, expandeespacios(ajustaa($DIA, 2)));
        extract($this->get_ingreso_pos());
        $this->mpdf->WriteText(172, 97, expandeespacios(ajustaa($LOFE, 4)));
        $this->mpdf->WriteText(172, 132, expandeespacios(ajustaa($CTITULO, 4)));
        $this->mpdf->WriteText(172, 140, expandeespacios(ajustaa($STITULO, 4)));
        $this->mpdf->WriteText(172, 148, expandeespacios(ajustaa($TITULO, 4)));

        $this->mpdf->WriteText(138, 186.5, expandeespacios(ajustaa($TNIH, 4)));
        $this->mpdf->WriteText(169, 186.5, expandeespacios(ajustaa($TNIM, 4)));
        $this->mpdf->WriteText(204.5, 186.5, expandeespacios(ajustaa($TNIT, 4)));
        $this->mpdf->WriteText(234.5, 186.5, expandeespacios(ajustaa($TOT_NIDIS, 4)));
    }

    function hoja5() {
        extract($this->get_generales_pos());
        extract($this->get_ingreso_pos());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 5)), true);
        $this->mpdf->WriteHTML($vista);

        $b = 52;
        $this->mpdf->WriteText(84, $b, expandeespacios(ajustaa($B1, 4)));
        $this->mpdf->WriteText(84, $b + 6, expandeespacios(ajustaa($B2, 4)));
        $this->mpdf->WriteText(84, $b + 12, expandeespacios(ajustaa($B3, 4)));
        $this->mpdf->WriteText(84, $b + 18, expandeespacios(ajustaa($B4, 4)));

        $b = 78;
        $this->mpdf->WriteText(84, $b, expandeespacios(ajustaa($B5, 4)));
        $this->mpdf->WriteText(84, $b + 6, expandeespacios(ajustaa($B6, 4)));
        $this->mpdf->WriteText(84, $b + 12, expandeespacios(ajustaa($B7, 4)));
        $this->mpdf->WriteText(84, $b + 18, expandeespacios(ajustaa($B8, 4)));

        $b = 104;
        $this->mpdf->WriteText(84, $b, expandeespacios(ajustaa($B9, 4)));
        $this->mpdf->WriteText(84, $b + 6, expandeespacios(ajustaa($B10, 4)));
        $this->mpdf->WriteText(84, $b + 12, expandeespacios(ajustaa($B11, 4)));
        $this->mpdf->WriteText(84, $b + 18, expandeespacios(ajustaa($B12, 4)));

        $b = 130;
        $this->mpdf->WriteText(84, $b, expandeespacios(ajustaa($B13, 4)));
        $this->mpdf->WriteText(84, $b + 6, expandeespacios(ajustaa($B14, 4)));
        $this->mpdf->WriteText(84, $b + 12, expandeespacios(ajustaa($B15, 4)));
        $this->mpdf->WriteText(84, $b + 18, expandeespacios(ajustaa($B16, 4)));

        $b = 52;
        $this->mpdf->WriteText(153, $b, expandeespacios(ajustaa($B17, 4)));
        $this->mpdf->WriteText(153, $b + 6, expandeespacios(ajustaa($B18, 4)));
        $this->mpdf->WriteText(153, $b + 12, expandeespacios(ajustaa($B19, 4)));
        $this->mpdf->WriteText(153, $b + 18, expandeespacios(ajustaa($B20, 4)));
        $b = 78;
        $this->mpdf->WriteText(153, $b, expandeespacios(ajustaa($B21, 4)));
        $this->mpdf->WriteText(153, $b + 6, expandeespacios(ajustaa($B22, 4)));
        $this->mpdf->WriteText(153, $b + 12, expandeespacios(ajustaa($B23, 4)));
        $this->mpdf->WriteText(153, $b + 18, expandeespacios(ajustaa($B24, 4)));
        $b = 104;
        $this->mpdf->WriteText(153, $b, expandeespacios(ajustaa($B25, 4)));
        $this->mpdf->WriteText(153, $b + 6, expandeespacios(ajustaa($B26, 4)));
        $this->mpdf->WriteText(153, $b + 12, expandeespacios(ajustaa($B27, 4)));
        $this->mpdf->WriteText(153, $b + 18, expandeespacios(ajustaa($B28, 4)));
        $b = 130.5;
        $this->mpdf->WriteText(153, $b, expandeespacios(ajustaa($B29, 4)));
        $this->mpdf->WriteText(153, $b + 6, expandeespacios(ajustaa($B30, 4)));
        $this->mpdf->WriteText(153, $b + 12, expandeespacios(ajustaa($B31, 4)));
        $this->mpdf->WriteText(153, $b + 18, expandeespacios(ajustaa($B32, 4)));

        $b = 50;
        $this->mpdf->WriteText(233, $b, expandeespacios(ajustaa($BEU, 4)));
        $this->mpdf->WriteText(233, $b + 6, expandeespacios(ajustaa($BCA, 4)));
        $this->mpdf->WriteText(233, $b + 12, expandeespacios(ajustaa($BCC, 4)));
        $this->mpdf->WriteText(233, $b + 18, expandeespacios(ajustaa($BSU, 4)));
        $this->mpdf->WriteText(233, $b + 24, expandeespacios(ajustaa($BAF, 4)));
        $this->mpdf->WriteText(233, $b + 30, expandeespacios(ajustaa($BAS, 4)));
        $this->mpdf->WriteText(233, $b + 36, expandeespacios(ajustaa($BEUR, 4)));
        $this->mpdf->WriteText(233, $b + 42, expandeespacios(ajustaa($BOC, 4)));

        $this->mpdf->WriteText(233, 149, expandeespacios(ajustaa($TBAC, 4)));

        $this->mpdf->WriteText(196, 172.5, expandeespacios(ajustaa($N30, 5)));
        $this->mpdf->WriteText(196, 178.5, expandeespacios(ajustaa($ND30, 5)));
        $this->mpdf->WriteText(196, 185, expandeespacios(ajustaa($N157, 5)));
        $this->mpdf->WriteText(196, 191, expandeespacios(ajustaa($TNAC_OTPA, 5)));
        $this->mpdf->WriteText(196, 199.5, expandeespacios(ajustaa($TNAC, 5)));
    }

    function hoja6() {
        extract($this->get_generales_pos());
        $r = ($this->get_ingreso_pos());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 6)), true);
        $this->mpdf->WriteHTML($vista);


        $x = 32.5;
        $y = 201;
        $TNIMAS24 = $r['TNIM18'] + $r['TNI18'] + $r['TNI19'] + $r['TNI20'] + $r['TNI21'] + $r['TNI22'] + $r['TNI23'] + $r['TNI24'];
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($TNIMAS24, 4)));
        $this->mpdf->WriteText($y, $x + 7, expandeespacios(ajustaa($r['TNI25'], 4)));
        $this->mpdf->WriteText($y, $x + 14, expandeespacios(ajustaa($r['TNI26'], 4)));
        $this->mpdf->WriteText($y, $x + 21, expandeespacios(ajustaa($r['TNI27'], 4)));
        $this->mpdf->WriteText($y, $x + 28, expandeespacios(ajustaa($r['TNI28'], 4)));
        $this->mpdf->WriteText($y, $x + 35, expandeespacios(ajustaa($r['TNI29'], 4)));
        $this->mpdf->WriteText($y, $x + 42, expandeespacios(ajustaa($r['TNI3034'], 4)));
        $this->mpdf->WriteText($y, $x + 49, expandeespacios(ajustaa($r['TNI3539'], 4)));
        $this->mpdf->WriteText($y, $x + 56.5, expandeespacios(ajustaa($r['TNIM39'], 4)));
        $this->mpdf->WriteText($y, $x + 63.5, expandeespacios(ajustaa($r['TNIT'], 4)));

        $r = ($this->get_permanencia_pos());
        $x = 118.5;
        $y = 152;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['AV1H'], 4)));
        $this->mpdf->WriteText($y, $x + 7, expandeespacios(ajustaa($r['AV2H'], 4)));
        $this->mpdf->WriteText($y, $x + 14, expandeespacios(ajustaa($r['AV3H'], 4)));
        $this->mpdf->WriteText($y, $x + 21, expandeespacios(ajustaa($r['AV4H'], 4)));
        $this->mpdf->WriteText($y, $x + 28, expandeespacios(ajustaa($r['AV5H'], 4)));
        $this->mpdf->WriteText($y, $x + 35.5, expandeespacios(ajustaa($r['TAVH'], 4)));

        $x = 118.5;
        $y = 184;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['AV1M'], 4)));
        $this->mpdf->WriteText($y, $x + 7, expandeespacios(ajustaa($r['AV2M'], 4)));
        $this->mpdf->WriteText($y, $x + 14, expandeespacios(ajustaa($r['AV3M'], 4)));
        $this->mpdf->WriteText($y, $x + 21, expandeespacios(ajustaa($r['AV4M'], 4)));
        $this->mpdf->WriteText($y, $x + 28, expandeespacios(ajustaa($r['AV5M'], 4)));
        $this->mpdf->WriteText($y, $x + 35.5, expandeespacios(ajustaa($r['TAVM'], 4)));

        $x = 118.5;
        $y = 215;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['PRIM'], 4)));
        $this->mpdf->WriteText($y, $x + 7, expandeespacios(ajustaa($r['SEGU'], 4)));
        $this->mpdf->WriteText($y, $x + 14, expandeespacios(ajustaa($r['TERC'], 4)));
        $this->mpdf->WriteText($y, $x + 21, expandeespacios(ajustaa($r['CUAR'], 4)));
        $this->mpdf->WriteText($y, $x + 28, expandeespacios(ajustaa($r['QUIN'], 4)));
        $this->mpdf->WriteText($y, $x + 35.5, expandeespacios(ajustaa($r['TAVA'], 4)));

        $x = 118.5;
        $y = 242;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['A1DT'], 4)));
        $this->mpdf->WriteText($y, $x + 7, expandeespacios(ajustaa($r['A2DT'], 4)));
        $this->mpdf->WriteText($y, $x + 14, expandeespacios(ajustaa($r['A3DT'], 4)));
        $this->mpdf->WriteText($y, $x + 21, expandeespacios(ajustaa($r['A4DT'], 4)));
        $this->mpdf->WriteText($y, $x + 28, expandeespacios(ajustaa($r['A5DT'], 4)));
        $this->mpdf->WriteText($y, $x + 35.5, expandeespacios(ajustaa($r['TADT'], 4)));

        $this->mpdf->WriteText(166.5, 175.5, expandeespacios(ajustaa($r['POB_AB'], 4)));

        $this->mpdf->WriteText(205, 175.5, expandeespacios(ajustaa($r['POB_VI_DI'], 4)));

        $this->mpdf->WriteText(154.5, 200.5, expandeespacios(ajustaa($r['MHLI'], 4)));
        $this->mpdf->WriteText(182.5, 200.5, expandeespacios(ajustaa($r['MMLI'], 4)));
        $this->mpdf->WriteText(214.5, 200.5, expandeespacios(ajustaa($r['TMLI'], 4)));
        $this->mpdf->WriteText(247, 200.5, expandeespacios(ajustaa($r['TLID'], 3)));
    }

    function hoja7() {
        extract($this->get_generales_pos());
        $r = ($this->get_ingreso_pos());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 7)), true);
        $this->mpdf->WriteHTML($vista);
    }

    function hoja8() {
        extract($this->get_generales_pos());
        $r = ($this->get_permanencia_pos());

        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 8)), true);
        $this->mpdf->WriteHTML($vista);

        $this->mpdf->WriteText(157, 28, expandeespacios(ajustaa($r['HDIS'], 4)));
        $this->mpdf->WriteText(185, 28, expandeespacios(ajustaa($r['MDIS'], 4)));
        $this->mpdf->WriteText(213.5, 28, expandeespacios(ajustaa($r['TDIS'], 4)));

        $x = 66;
        $y = 160;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['MH24'], 4)));
        $this->mpdf->WriteText($y, $x + 7, expandeespacios(ajustaa($r['MH25'], 4)));
        $this->mpdf->WriteText($y, $x + 14, expandeespacios(ajustaa($r['MH26'], 4)));
        $this->mpdf->WriteText($y, $x + 21, expandeespacios(ajustaa($r['MH27'], 4)));
        $this->mpdf->WriteText($y, $x + 28, expandeespacios(ajustaa($r['MH28'], 4)));
        $this->mpdf->WriteText($y, $x + 35, expandeespacios(ajustaa($r['MH29'], 4)));
        $this->mpdf->WriteText($y, $x + 42, expandeespacios(ajustaa($r['MH3034'], 4)));
        $this->mpdf->WriteText($y, $x + 49, expandeespacios(ajustaa($r['MH3539'], 4)));
        $this->mpdf->WriteText($y, $x + 56, expandeespacios(ajustaa($r['MH40'], 4)));
        $this->mpdf->WriteText($y, $x + 63, expandeespacios(ajustaa($r['TMAH'], 4)));

        $x = 66;
        $y = 188;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['MM24'], 4)));
        $this->mpdf->WriteText($y, $x + 7, expandeespacios(ajustaa($r['MM25'], 4)));
        $this->mpdf->WriteText($y, $x + 14, expandeespacios(ajustaa($r['MM26'], 4)));
        $this->mpdf->WriteText($y, $x + 21, expandeespacios(ajustaa($r['MM27'], 4)));
        $this->mpdf->WriteText($y, $x + 28, expandeespacios(ajustaa($r['MM28'], 4)));
        $this->mpdf->WriteText($y, $x + 35, expandeespacios(ajustaa($r['MM29'], 4)));
        $this->mpdf->WriteText($y, $x + 42, expandeespacios(ajustaa($r['MM3034'], 4)));
        $this->mpdf->WriteText($y, $x + 49, expandeespacios(ajustaa($r['MM3539'], 4)));
        $this->mpdf->WriteText($y, $x + 56, expandeespacios(ajustaa($r['MM40'], 4)));
        $this->mpdf->WriteText($y, $x + 63, expandeespacios(ajustaa($r['TMAM'], 4)));

        $x = 66;
        $y = 216;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['SM24'], 4)));
        $this->mpdf->WriteText($y, $x + 7, expandeespacios(ajustaa($r['SM25'], 4)));
        $this->mpdf->WriteText($y, $x + 14, expandeespacios(ajustaa($r['SM26'], 4)));
        $this->mpdf->WriteText($y, $x + 21, expandeespacios(ajustaa($r['SM27'], 4)));
        $this->mpdf->WriteText($y, $x + 28, expandeespacios(ajustaa($r['SM28'], 4)));
        $this->mpdf->WriteText($y, $x + 35, expandeespacios(ajustaa($r['SM29'], 4)));
        $this->mpdf->WriteText($y, $x + 42, expandeespacios(ajustaa($r['SM3034'], 4)));
        $this->mpdf->WriteText($y, $x + 49, expandeespacios(ajustaa($r['SM3539'], 4)));
        $this->mpdf->WriteText($y, $x + 56, expandeespacios(ajustaa($r['SM40'], 4)));
        $this->mpdf->WriteText($y, $x + 63, expandeespacios(ajustaa($r['TMAT'], 4)));

        $x = 66;
        $y = 239;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['TD24'], 4)));
        $this->mpdf->WriteText($y, $x + 7, expandeespacios(ajustaa($r['TD25'], 4)));
        $this->mpdf->WriteText($y, $x + 14, expandeespacios(ajustaa($r['TD26'], 4)));
        $this->mpdf->WriteText($y, $x + 21, expandeespacios(ajustaa($r['TD27'], 4)));
        $this->mpdf->WriteText($y, $x + 28, expandeespacios(ajustaa($r['TD28'], 4)));
        $this->mpdf->WriteText($y, $x + 35, expandeespacios(ajustaa($r['TD29'], 4)));
        $this->mpdf->WriteText($y, $x + 42, expandeespacios(ajustaa($r['TD3034'], 4)));
        $this->mpdf->WriteText($y, $x + 49, expandeespacios(ajustaa($r['TD3539'], 4)));
        $this->mpdf->WriteText($y, $x + 56, expandeespacios(ajustaa($r['TD40'], 4)));
        $this->mpdf->WriteText($y, $x + 63, expandeespacios(ajustaa($r['TDIS_EDAD'], 4)));

        $x = 165.3;
        $y = 160;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['FPN'], 4)));
        $this->mpdf->WriteText($y, $x + 7, expandeespacios(ajustaa($r['FIN'], 4)));
        $this->mpdf->WriteText($y, $x + 14, expandeespacios(ajustaa($r['FBN'], 4)));
        $this->mpdf->WriteText($y, $x + 21, expandeespacios(ajustaa($r['FON'], 4)));
        $this->mpdf->WriteText($y, $x + 28, expandeespacios(ajustaa($r['FTN'], 4)));
        $x = 165.3;
        $y = 197;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['FPE'], 4)));
        $this->mpdf->WriteText($y, $x + 7, expandeespacios(ajustaa($r['FIE'], 4)));
        $this->mpdf->WriteText($y, $x + 14, expandeespacios(ajustaa($r['FBE'], 4)));
        $this->mpdf->WriteText($y, $x + 21, expandeespacios(ajustaa($r['FOE'], 4)));
        $this->mpdf->WriteText($y, $x + 28, expandeespacios(ajustaa($r['FTE'], 4)));
    }

    function hoja9() {
        extract($this->get_generales_pos());
        $r = ($this->get_ingreso_pos());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 9)), true);
        $this->mpdf->WriteHTML($vista);
        $año = '2011'; //ajustaa(date('Y'), 4);
        $this->mpdf->WriteText(193, 125.5, expandeespacios($año));
        $mes = '10'; //ajustaa(date('m'), 2);
        $this->mpdf->WriteText(221, 125.5, expandeespacios($mes));
        $dia = '20'; //ajustaa(date('d'), 2);
        $this->mpdf->WriteText(238, 125.5, expandeespacios($dia));
        $responsablecarrera = $SECRE;
        $this->mpdf->WriteText(30, 121, $responsablecarrera);
        $responsablellenado = 'DR. RAGUEB CHAÍN REVUELTA';
        $this->mpdf->WriteText(35, 162, $responsablellenado);
    }

    function hoja10() {
        extract($this->get_generales_pos());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 10)), true);
        $this->mpdf->WriteHTML($vista);
    }

    function hoja11() {
        extract($this->get_generales_pos());
        
            $r = ($this->get_docentes_esco());
 
        
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 11)), true);
        $this->mpdf->WriteHTML($vista);
        /*if ($r == null) {
            $r['PD1H'] = 0;
            $r['PD2H'] = 0;
            $r['PD3H'] = 0;
            $r['PD4H'] = 0;
            $r['SPDH'] = 0;
            $r['PD1M'] = 0;
            $r['PD2M'] = 0;
            $r['PD3M'] = 0;
            $r['PD4M'] = 0;
            $r['SPDM'] = 0;

            $r['PD1T'] = 0;
            $r['PD2T'] = 0;
            $r['PD3T'] = 0;
            $r['PD4T'] = 0;
            $r['SPDT'] = 0;

            $r['PD1D'] = 0;
            $r['PD2D'] = 0;
            $r['PD3D'] = 0;
            $r['PD4D'] = 0;
            $r['SPDD'] = 0;

            //docentes
            $r['D1TT'] = 0;
            $r['D2TT'] = 0;
            $r['D3TT'] = 0;
            $r['D4TT'] = 0;
            $r['SDTT'] = 0;

            $r['D1TN'] = 0;
            $r['D2TN'] = 0;
            $r['D3TN'] = 0;
            $r['D4TN'] = 0;
            $r['SDTN'] = 0;

            $r['D1LT'] = 0;
            $r['D2LT'] = 0;
            $r['D3LT'] = 0;
            $r['D4LT'] = 0;
            $r['SDLT'] = 0;
            $r['D1LN'] = 0;
            $r['D2LN'] = 0;
            $r['D3LN'] = 0;
            $r['D4LN'] = 0;
            $r['SDLN'] = 0;

            $r['D1ET'] = 0;
            $r['D2ET'] = 0;
            $r['D3ET'] = 0;
            $r['D4ET'] = 0;
            $r['SDET'] = 0;

            $r['D1EP'] = 0;
            $r['D2EP'] = 0;
            $r['D3EP'] = 0;
            $r['D4EP'] = 0;
            $r['SDEP'] = 0;

            $r['D1MG'] = 0;
            $r['D2MG'] = 0;
            $r['D3MG'] = 0;
            $r['D4MG'] = 0;
            $r['SDMG'] = 0;
            $r['D1MS'] = 0;
            $r['D2MS'] = 0;
            $r['D3MS'] = 0;
            $r['D4MS'] = 0;
            $r['SDMS'] = 0;
            $r['D1DG'] = 0;
            $r['D2DG'] = 0;
            $r['D3DG'] = 0;
            $r['D4DG'] = 0;
            $r['SDDG'] = 0;
            $r['D1DS'] = 0;
            $r['D2DS'] = 0;
            $r['D3DS'] = 0;
            $r['D4DS'] = 0;
            $r['SDDS'] = 0;
            $r['INVICON'] = '0';
            $r['SUMALIC'] = '0';
        }*/
        //discapacitados docentes
        $x = 91.3;
        $y = 57;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['PD1H'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['PD2H'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['PD3H'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['PD4H'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SPDH'], 4)));

        $x = 91.3;
        $y = 80;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['PD1M'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['PD2M'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['PD3M'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['PD4M'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SPDM'], 4)));

        $x = 91.3;
        $y = 106.5;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['PD1T'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['PD2T'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['PD3T'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['PD4T'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SPDT'], 4)));

        $x = 91.3;
        $y = 129;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['PD1D'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['PD2D'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['PD3D'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['PD4D'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SPDD'], 4)));

        //docentes

        $x = 153.6;
        $y = 57;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1TT'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['D2TT'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['D3TT'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['D4TT'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SDTT'], 4)));

        $x = 153.6;
        $y = 77;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1TN'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['D2TN'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['D3TN'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['D4TN'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SDTN'], 4)));

        $x = 153.6;
        $y = 97;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1LT'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['D2LT'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['D3LT'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['D4LT'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SDLT'], 4)));

        $x = 153.6;
        $y = 117;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1LN'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['D2LN'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['D3LN'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['D4LN'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SDLN'], 4)));

        $x = 153.6;
        $y = 137;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1ET'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['D2ET'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['D3ET'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['D4ET'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SDET'], 4)));

        $x = 153.6;
        $y = 157;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1EP'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['D2EP'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['D3EP'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['D4EP'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SDEP'], 4)));

        $x = 153.6;
        $y = 177;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1MG'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['D2MG'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['D3MG'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['D4MG'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SDMG'], 4)));
        $x = 153.6;
        $y = 197;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1MS'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['D2MS'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['D3MS'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['D4MS'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SDMS'], 4)));

        $x = 153.6;
        $y = 217.5;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1DG'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['D2DG'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['D3DG'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['D4DG'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SDDG'], 4)));
        $x = 153.6;
        $y = 237;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1DS'], 4)));
        $this->mpdf->WriteText($y, $x + 6, expandeespacios(ajustaa($r['D2DS'], 4)));
        $this->mpdf->WriteText($y, $x + 12, expandeespacios(ajustaa($r['D3DS'], 4)));
        $this->mpdf->WriteText($y, $x + 18, expandeespacios(ajustaa($r['D4DS'], 4)));
        $this->mpdf->WriteText($y, $x + 26, expandeespacios(ajustaa($r['SDDS'], 4)));

        $this->mpdf->WriteText(67.3, 190.9, (string)$r['INVICON']);
        $this->mpdf->WriteText(221.8, 194.8, (string)$r['SUMALIC']);
    }

    function hoja12() {
        extract($this->get_generales_pos());
          $r = ($this->get_docentes_noesco());
        
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest_posgrado', array('pagina' => sprintf("%02d", 12)), true);
        $this->mpdf->WriteHTML($vista);
        
        /*if ($r == null) {
            $r['PD1H2'] = 0;
            $r['PD2H2'] = 0;
            $r['PD3H2'] = 0;
            $r['PD4H2'] = 0;
            $r['SPDH2'] = 0;
            $r['PD1M2'] = 0;
            $r['PD2M2'] = 0;
            $r['PD3M2'] = 0;
            $r['PD4M2'] = 0;
            $r['SPDM2'] = 0;

            $r['PD1T2'] = 0;
            $r['PD2T2'] = 0;
            $r['PD3T2'] = 0;
            $r['PD4T2'] = 0;
            $r['SPDT2'] = 0;

            $r['PD1D2'] = 0;
            $r['PD2D2'] = 0;
            $r['PD3D2'] = 0;
            $r['PD4D2'] = 0;
            $r['SPDD2'] = 0;

            //docentes
            $r['D1TT2'] = 0;
            $r['D2TT2'] = 0;
            $r['D3TT2'] = 0;
            $r['D4TT2'] = 0;
            $r['SDTT2'] = 0;

            $r['D1TN2'] = 0;
            $r['D2TN2'] = 0;
            $r['D3TN2'] = 0;
            $r['D4TN2'] = 0;
            $r['SDTN2'] = 0;

            $r['D1LT2'] = 0;
            $r['D2LT2'] = 0;
            $r['D3LT2'] = 0;
            $r['D4LT2'] = 0;
            $r['SDLT2'] = 0;
            $r['D1LN2'] = 0;
            $r['D2LN2'] = 0;
            $r['D3LN2'] = 0;
            $r['D4LN2'] = 0;
            $r['SDLN2'] = 0;

            $r['D1ET2'] = 0;
            $r['D2ET2'] = 0;
            $r['D3ET2'] = 0;
            $r['D4ET2'] = 0;
            $r['SDET2'] = 0;

            $r['D1EP2'] = 0;
            $r['D2EP2'] = 0;
            $r['D3EP2'] = 0;
            $r['D4EP2'] = 0;
            $r['SDEP2'] = 0;

            $r['D1MG2'] = 0;
            $r['D2MG2'] = 0;
            $r['D3MG2'] = 0;
            $r['D4MG2'] = 0;
            $r['SDMG2'] = 0;
            $r['D1MS2'] = 0;
            $r['D2MS2'] = 0;
            $r['D3MS2'] = 0;
            $r['D4MS2'] = 0;
            $r['SDMS2'] = 0;
            $r['D1DG2'] = 0;
            $r['D2DG2'] = 0;
            $r['D3DG2'] = 0;
            $r['D4DG2'] = 0;
            $r['SDDG2'] = 0;
            $r['D1DS2'] = 0;
            $r['D2DS2'] = 0;
            $r['D3DS2'] = 0;
            $r['D4DS2'] = 0;
            $r['SDDS2'] = 0;
            $r['INVICON2'] = '0';
            $r['SUMALIC2'] = '0';
        }*/
        //discapacitados docentes
         $x=91.3;
          $y=57;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['PD1H2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['PD2H2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['PD3H2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['PD4H2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SPDH2'], 4)));

          $x=91.3;
          $y=80;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['PD1M2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['PD2M2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['PD3M2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['PD4M2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SPDM2'], 4)));

          $x=91.3;
          $y=106.5;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['PD1T2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['PD2T2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['PD3T2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['PD4T2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SPDT2'], 4)));

          $x=91.3;
          $y=129;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['PD1D2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['PD2D2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['PD3D2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['PD4D2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SPDD2'], 4)));

          //docentes
          
          $x=158.6;
          $y=57;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1TT2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['D2TT2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['D3TT2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['D4TT2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SDTT2'], 4)));

          $x=158.6;
          $y=77;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1TN2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['D2TN2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['D3TN2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['D4TN2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SDTN2'], 4)));

          $x=158.6;
          $y=97;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1LT2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['D2LT2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['D3LT2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['D4LT2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SDLT2'], 4)));

          $x=158.6;
          $y=117;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1LN2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['D2LN2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['D3LN2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['D4LN2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SDLN2'], 4)));

          $x=158.6;
          $y=137;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1ET2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['D2ET2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['D3ET2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['D4ET2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SDET2'], 4)));

          $x=158.6;
          $y=157;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1EP2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['D2EP2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['D3EP2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['D4EP2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SDEP2'], 4)));

          $x=158.6;
          $y=177;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1MG2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['D2MG2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['D3MG2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['D4MG2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SDMG2'], 4)));
          $x=158.6;
          $y=197;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1MS2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['D2MS2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['D3MS2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['D4MS2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SDMS2'], 4)));

          $x=158.6;
          $y=217.5;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1DG2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['D2DG2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['D3DG2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['D4DG2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SDDG2'], 4)));
          $x=158.6;
          $y=237;
          $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['D1DS2'], 4)));
          $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['D2DS2'], 4)));
          $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['D3DS2'], 4)));
          $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['D4DS2'], 4)));
          $this->mpdf->WriteText($y, $x+26, expandeespacios(ajustaa($r['SDDS2'], 4)));


          $this->mpdf->WriteText(59.7, 195.9, (string)$r['INVICON2']);
          $this->mpdf->WriteText(214.2, 199.8,(string)$r['SUMALIC2']); 
    }

}

